class Transaction;

    static int count=0;
    int id;
    function new();
        id=count++;  
    endfunction
    static function void display_count();
        $display("count=%0d",count); 
    endfunction

endclass


module testbench; 
Transaction t1,t2;
initial begin
    $display("\033[32m\t\t!!\tcode begin\t!!");  
    Transaction::count=3;
    $display("static count = %0d",Transaction::count);
    Transaction::display_count();
    t1=new();
    t2=new();
    $display("t1.id = %0d",t1.id);
    $display("t2.id = %0d",t2.id);
    $display("count = ",Transaction::count);

    $display("\t\t!!\tcode end\t!!\033[0m");
    $finish; 
end 
endmodule 